#ifndef _NETWORK_INCLUDE_VSOMEIPCLIENT_H
#define _NETWORK_INCLUDE_VSOMEIPCLIENT_H

#include "network/include/Defs.h"
#include "network/include/ServiceAttribute.h"

#include <vsomeip/vsomeip.hpp>

#include <chrono>
#include <condition_variable>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <thread>
#include <memory>

class client_sample 
{
public:
    client_sample(bool _use_tcp, const uint8_t& number);

    bool init();
    void start();
    void stop();
    void on_state(vsomeip::state_type_e _state);
    void on_availability(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available);
    void on_message(const std::shared_ptr<vsomeip::message> &_response);
    void on_event(const std::shared_ptr<vsomeip::message> &_response);
    void sendRequest();

private:
    std::shared_ptr< vsomeip::application > app_;
    bool                                    use_tcp_;
    std::vector<ServiceAttribute>           itsServiceAttributes;
    uint8_t                                 itsServiceNumber;

    static constexpr auto MAX_SERVICE_COUNT = 2;
};


#endif